package com.movie.app.respository;

import java.util.List;

import com.movie.app.model.Article;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;

@RepositoryRestResource(collectionResourceRel = "articles", path = "articles")
public interface ArticleRepository extends MongoRepository<Article, String> {

  @Override
  @RestResource(exported = false)
  default <S extends Article> S save(S entity) {
    return null;
  }
  
  @Override
  @RestResource(exported = false)
  default void delete(Article entity) {
    // TODO Auto-generated method stub
    
  }

  @RestResource()
  List<Article> findByTitle(@Param("title") String title);
}